package cn.tedu._03vehicle.pojo.dto;


import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.*;
import org.hibernate.validator.constraints.Range;

@Data
public class UserRegParam {
    @NotNull(message = "用户名不能为空")
    //@NotEmpty(message = "用户名不能为空")
    //@NotBlank(message = "用户名不能为空且不能有空格")
    //@Size(min = 2, max = 20, message = "用户名长度必须在2-20之间")
    //@Range(min = 2, max = 20, message = "用户名大小必须2-20之间")
    @Pattern(regexp="^[a-zA-Z]{1,14}$|^[\\u4e00-\\u9fa5]{1,7}$",message = "用户名只能是英文或中文,且长度不能超过7个汉字或者14个字母")
    @Schema(required = true, description = "用户名",example = "admin")
    private String username;
    @Pattern(regexp="^(?!.*[\\s\\u4e00-\\u9fa5])(?=.*[a-zA-Z])(?=.*\\d)|(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?])(?=.*\\d)|(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?])(?=.*\\d)|(?=.*[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?])(?=.*\\d).{8,14}$",message = "密码长度必须在8-14之间,且必须包含数字、字母、特殊字符")
    @Schema(required = true, description = "密码",example = "123456")
    private String password;
    @Schema(required = true, description = "邮箱",example = "admin@tedu.cn")
    private String email;
    @Schema(required = true, description = "手机号",example = "13800000000")
    private String phone;
}
